﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="BannerList.aspx.cs" Inherits="webadmin_BannerList" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link type="text/css" href="css/style.css" rel="stylesheet" />
    <script type="text/javascript" src="../js/jquery.js"></script>
    <script type="text/javascript" src="js/lib.js"></script>
    <script type="text/javascript">
        $(function () {
            BindBtn();
            AddTrClass($("#listinfo"));
        })
        function ShowDialog(type,id){
        var url="",title,name;
        var bannertype=<%=(int)eType%>;
        var name = "<%=Until.GetAdverName(eType)%>";
        switch(type)
        {
            case 1:
                title="编辑"+name;
                url="DoBanner.aspx?type=edit&advertype="+bannertype+"&id="+id;
                break;
            case 2:
                title="新增"+name;
                url="DoBanner.aspx?type=add&advertype="+bannertype;
                break;
        }
        top.CreateIframe(title,url,450,150);
    }
    </script>
</head>
<body>
    <form id="form1" runat="server" style="height: 100%;">
    <div id="conBox">
        <div class="grid-box" style="padding-top: 10px">
            <div class="ctrlbar">
                <div class="f-left">
                </div>
                <div class="f-right" style="<%=CheckDisplay2()%>">
                    <a href="javascript:void(0);" id="btnDel" class="toolbtn" style="display: none;">
                        <img src="images/ico-delete.gif" alt="删除" />删 除</a> <a href="javascript:ShowDialog(2,0)"
                            class="toolbtn">
                            <img src="images/ico-add.gif" alt="新增" />新 增</a>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="grid-box">
                <table class="grid-table">
                    <thead>
                        <tr>
                            <th class="align-l" style="<%=CheckDisplay4()%>">
                                图片
                            </th>
                            <td>
                                名称
                            </td>
                            <td style="<%=CheckDisplay3()%>">
                                分类
                            </td>
                            <td style="<%=CheckDisplay()%>">
                                链接地址
                            </td>
                            <td class="align-c" style="<%=CheckDisplay1()%>">
                                上移
                            </td>
                            <td class="align-c" style="<%=CheckDisplay1()%>">
                                下移
                            </td>
                            <td class="align-c">
                                编辑
                            </td>
                            <td class="align-c" style="<%=CheckDisplay2()%>">
                                删除
                            </td>
                        </tr>
                    </thead>
                    <tbody id="listinfo">
                        <asp:Repeater ID="rptBanner" runat="server" OnItemDataBound="rptBanner_ItemDataBound"  OnItemCommand="rptBanner_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td style="padding:2px 0;<%#CheckDisplay4()%>">
                                        <img src="<%#"../"+WebConfigInfo.FilePlace + "d/"+Eval("ImgPlace")%>" alt="" style="width:150px;" /></a>
                                    </td>
                                    <td>
                                        <%#Server.HtmlEncode(Eval("Name").ToString())%>
                                    </td>
                                    <td style="<%#CheckDisplay3()%>">
                                        <%#Server.HtmlEncode(Eval("SortName").ToString())%>
                                    </td>
                                    <td style="<%#CheckDisplay()%>">
                                        <a href="<%#Eval("Url")%>" target="_blank"><%#Eval("Url")%></a>
                                    </td>
                                     <td class='align-c' style="<%=CheckDisplay1()%>">
                                         <asp:HiddenField ID="hfID" runat="server" Value='<%#Eval("ID")+","+Eval("OrderNum")%>' />
                                        <asp:ImageButton ID="btnUp" CommandName="OrderUp" CommandArgument='<%#Eval("ID")+","+Eval("OrderNum")%>' ImageUrl="images/up.gif" runat="server" ToolTip="上移" />
                                    </td>
                                    <td class='align-c' style="<%=CheckDisplay1()%>">
                                        <asp:ImageButton ID="btnDown" CommandName="OrderDown" CommandArgument='<%#Eval("ID")+","+Eval("OrderNum")%>' ImageUrl="images/down.gif" runat="server" ToolTip="下移" />
                                    </td>
                                    <td class='align-c'>
                                        <a href="javascript:ShowDialog(1,<%#Eval("ID")%>)">
                                            <img alt="编辑" src="images/ico-edit.gif" /></a>
                                    </td>
                                    <td class='align-c' style="<%=CheckDisplay2()%>">
                                        <asp:ImageButton ID="btnDelete" runat="server" CommandName="Delete" CommandArgument='<%#Eval("ID")+","+Eval("ImgPlace")%>'
                                            ImageUrl="images/ico-delete.gif" OnClientClick="return confirm('确定要删除该信息吗?');"
                                            ToolTip="删除" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
                <div id="noData" runat="server">
                    <div class="noDateMsg">
                        没有任何信息！</div>
                </div>
            </div>
        </div>
    </div>
    <asp:Button ID="btnReset" runat="server" Text="刷新" OnClick="btnReset_Click" CssClass="button"  style="display:none;" />
    </form>
</body>
</html>
